package com.lin.missyou.vo;

import com.lin.missyou.model.Coupon;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

import javax.persistence.Id;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author gcq
 * @Create 2021-11-03
 */
@Getter
@Setter
public class CouponPureVo {
    private Long id;
    private String title;
    private Date startTime;
    private Date endTime;
    private String description;
    private BigDecimal fullMoney;
    private BigDecimal minus;
    private BigDecimal rate;
    private short type;
    private Long activityId;
    private Boolean wholeStore;

    public CouponPureVo(Object object) {
        BeanUtils.copyProperties(object, this);
    }

    public static List<CouponPureVo> getList(List<Coupon> couponList)
    {
        return couponList.stream()
                .map(CouponPureVo::new)
                .collect(Collectors.toList());
    }
}